Skip to content

NPA-6426: Correctly specify and handle FHIR composite search logic for GET Consent status#327

Open
tomknapp wants to merge 1 commit intomasterfrom
task/NPA-6426/get-consent-filter-by-status-array
Open

NPA-6426: Correctly specify and handle FHIR composite search logic for GET Consent status#327
tomknapp wants to merge 1 commit intomasterfrom
task/NPA-6426/get-consent-filter-by-status-array

Conversation

@tomknapp
Copy link
Copy Markdown
Contributor

@tomknapp tomknapp commented Apr 7, 2026

Pull Request

🧾 Ticket Link

https://nhsd-jira.digital.nhs.uk/browse/NPA-6426


📄 Description/Summary of Changes

  • Specify AND/OR composite search for GET Consent 'status' parameter
  • Add validation to sandbox to handle composite criteria
  • Add test coverage for status combinations

🧪 Developer Testing Carried Out


📋 PR Principles

  • Keep PRs Small and Focused: Ensure the PR addresses a single task or feature to make it easier to review.
  • Multiple PRs for one Ticket: When splitting work into multiple PRs, clearly describe what this PR addresses and outline the remaining work to complete the ticket.
  • Ensure Tests Are Included: Add or update unit, integration, or end-to-end tests to cover the changes made.
  • Follow Coding Standards: Ensure the code adheres to the team's coding guidelines and best practices.
  • Resolve Comments Promptly: If you raise a comment, ensure you follow up and resolve it before approving the PR to maintain clarity and ensure comments are addressed.
  • Foster Learning: PR reviews are an opportunity to share knowledge, provide constructive feedback, and encourage a collaborative environment.

🏷️ Naming Conventions Reminder

Please ensure the following naming conventions are followed:

  • PR title follows the format: NPA-XXXX: <short-description>
  • Branch name follows the convention: <type>/NPA-XXXX/<short-description>
  • Commit messages follow the template: NPA-XXXX: <short-description>

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 7, 2026

This branch is work on a ticket in the NHS Digital NPA JIRA Project. Here's a handy link to the ticket:

NPA-6426


- **AND** — repeated parameters, e.g. `status=active&status=proposed`. For a single-valued field like `status`, AND groups are intersected; disjoint groups will return no results.

- **AND of ORs** — e.g. `status=active,proposed&status=inactive`.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Am i right in thinking this produces no results - because the AND will return no results as no proxy role has multiple statuses?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that's my understanding. I've put logic in the get consent lambda validation to return a 422 in this instance. As you say, status is a singleton value for each proxy role, so any AND values that aren't an exact intersect of each other I've treated as invalid because it may give unexpected results.
i.e. for "status=active, proposed&status=active" the caller may be expecting active or proposed, but this could only return active roles because of the extra AND active clause.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants